package patterndesign.template;

/**
 * @Description
 * @Date 2021/9/15
 * @Created by Jonathan
 */
public class HummerH1Model extends HummerModel {

    private boolean alarmFlag = true; // 要想喇叭

    @Override
    protected void start() {
        System.out.println("悍马H1汽车启动！");
    }

    @Override
    protected void stop() {
        System.out.println("悍马H1汽车停止！");

    }

    @Override
    protected void alarm() {
        System.out.println("悍马H1汽车鸣笛！");

    }

    @Override
    protected void engineBoom() {

    }

    public boolean isAlarm() {
        return alarmFlag;
    }

    /**
     * @param alarmFlag 要不要响喇叭由客户决定
     */
    public void setAlarmFlag(boolean alarmFlag) {
        this.alarmFlag = alarmFlag;
    }
}
